package chapter06.ExamPle19;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeMap;

public class Example19 {
    public static void main(String[] args){
        TreeMap map = new TreeMap();
        map.put(3,"李四");
        map.put(2,"王五");
        map.put(4,"赵六");
        map.put(3,"张三");
        //导出key队列（map有key队列和value队列）
        Set keySet = map.keySet();
        //获取到TreeSet以后 排序显示
        Iterator it = keySet.iterator();
        while (it.hasNext()){
            Object key = it.next();
            Object value = map.get(key);
            System.out.println(key +":"+value);
        }
    }
}
